 
<div class="form-group">
    <label class="col-sm-2 control-label">推荐人获得</label>
    <div class="col-sm-9 col-xs-12">
        {ife 'postera' $item}
        <div class="input-group">
            <input type="text" name="reccredit" class="form-control" value="{$item['reccredit']}" />
            <div class="input-group-addon">积分</div>
            <input type="text" name="recmoney" class="form-control" value="{$item['recmoney']}" />
            <div class="input-group-addon">元现金</div>
            
        </div>
        {else} 
        <div class='form-control-static'>
            {if !empty($item['recredit'])}{$item['reccredit']} 积分; {/if}
            {if !empty($item['recmoney'])}{$item['recmoney']} 元现金; {/if}
            
        </div> 
        {/if}
    </div>
</div>

	{if $plugin_coupon}
	
		<div class="form-group">
			<label class="col-sm-2 control-label"></label>
			<div class="col-sm-9 col-xs-12">
				{ife 'postera' $item}
					<div class="input-group recgroup">
						<div class='input-group-btn '>
			                <?php echo tpl_selector('reccouponid',array(
			                'preview'=>false, 
			                'callback'=>'select_coupon', 
			                'input'=>false,
			                'url'=>webUrl('sale/coupon/query'),
			                'items'=>$reccoupon,
			                'placeholder'=>'优惠券名称',
			                'buttontext'=>!empty($reccoupon)?"赠送优惠券: [". $reccoupon['id']."]".$reccoupon['couponname']:"选择优惠券"))
			                ?>
						</div>
						<input type="text" name="reccouponnum" class="form-control" value="{$item['reccouponnum']}" />
						<div class="input-group-addon">张</div>
						<div class='input-group-btn'>
							<button type='button' onclick='removeCoupon("rec")'  class='btn btn-default' style='border-radius:0'><i class="fa fa-remove"></i></button>
						</div>
					</div>
				{else}
					{if !empty($reccoupon)}
				        <div class='form-control-static'>
				        	优惠券 [{$reccoupon['id']}]{$reccoupon['couponname']} {$item['reccouponnum']} 张
				        </div>
			        {/if}
			    {/if}
			</div>
		</div>
    {/if}

<div class="form-group">
    <label class="col-sm-2 control-label"></label>
    <div class="col-sm-9 col-xs-12">
        {ife 'postera' $item}
        <div class="input-group">
            <div class="input-group-addon">每月最多</div>
            <input type="text" name="reccredit_totle" class="form-control" value="{$item['reccredit_totle']}" />
            <div class="input-group-addon">积分&nbsp;&nbsp;&nbsp;每月最多</div>
            <input type="text" name="recmoney_totle" class="form-control" value="{$item['recmoney_totle']}" />
            <div class="input-group-addon">元现金{if $plugin_coupon}&nbsp;&nbsp;&nbsp;最多可获{/if}</div>
            {if $plugin_coupon}
            <input type="text" name="reccouponnum_totle" class="form-control" value="{$item['reccouponnum_totle']}" />
            <div class="input-group-addon">张优惠券</div>
            {/if}
        </div>
        <div class="help-block">设置每月上限获得积分和现金数,默认0为不限制</div>
        {else}
        <div class='form-control-static'>
            {if !empty($item['recredit'])}每月最多 {$item['reccredit_totle']} 积分; {/if}
            {if !empty($item['recmoney'])}每月最多 {$item['recmoney_totle']} 元现金; {/if}
            {if $plugin_coupon}
            {if !empty($item['recmoney'])}每月最多 {$item['reccouponnum_totle']} 张优惠券; {/if}
            {/if}
        </div>
        {/if}
    </div>
</div>

<div class="form-group">
    <label class="col-sm-2 control-label">关注者获得</label>
    <div class="col-sm-9 col-xs-12">
        {ife 'postera' $item}

        <div class="input-group">
            <input type="text" name="subcredit" class="form-control" value="{$item['subcredit']}" />
            <div class="input-group-addon">积分</div>
            <input type="text" name="submoney" class="form-control" value="{$item['submoney']}" />
            <div class="input-group-addon">元现金</div>
           
        </div>
        {else}
        <div class='form-control-static'>
            {if !empty($item['subcredit'])}{$item['subcredit']} 积分; {/if}
            {if !empty($item['submoney'])}{$item['submoney']} 元现金; {/if}
           
        </div>
        {/if}
    </div>
</div>
            {if $plugin_coupon}
         <div class="form-group">
    <label class="col-sm-2 control-label"></label>
    <div class="col-sm-9 col-xs-12">
        {ife 'postera' $item}
        <div class="input-group subgroup">
     
            <div class='input-group-btn '>
                <?php echo tpl_selector('subcouponid',array(
                'preview'=>false, 
                'callback'=>'select_coupon', 
                'input'=>false,
                'url'=>webUrl('sale/coupon/query',array('op'=>'query')),
                'items'=>$subcoupon,
                'placeholder'=>'优惠券名称',
                'buttontext'=>!empty($subcoupon)?"赠送优惠券: [". $subcoupon['id']."]".$subcoupon['couponname']:"选择优惠券"))
                ?>
            </div>
            <input type="text" name="subcouponnum" class="form-control" value="{$item['subcouponnum']}" />
            <div class="input-group-addon">张</div>
            <div class='input-group-btn'>
                <button type='button' onclick='removeCoupon("sub")'  class='btn btn-default' style='border-radius:0'><i class="fa fa-remove"></i></button>
            </div>
        </div>
        {else}
	        {if !empty($subcoupon)}
		        <div class='form-control-static'>
		            优惠券 [{$subcoupon['id']}]{$subcoupon['couponname']} {$item['subcouponnum']} 张
		        </div>
	        {/if}
        {/if}
    </div>
</div>
         {/if}
<div class="form-group">
    <label class="col-sm-2 control-label">奖励现金方式</label>
    <div class="col-sm-9 col-xs-12">
        {ife 'postera' $item}
        <label class="radio-inline">
            <input type="radio" name="paytype" value="0" {if empty($item['paytype'])}checked{/if} /> 余额
        </label>

        <label class="radio-inline">
            <input type="radio" name="paytype" value="1" {if $item['paytype']==1}checked{/if} /> 微信钱包
        </label>
        <span class='help-block'>如果奖励现金，选择微信钱包( 打到零钱包需要微信支付，并在后台上传证书)</span>
        {else}
        	<div class='form-control-static'>{if empty($item['paytype'])}余额{else}微信钱包{/if}</div>
        {/if}
    </div> 
</div>
         <script language="javascript">
         {if $plugin_coupon}
              
                function removeCoupon(type){
                      $(":input[name=" + type + "couponid]").val('');
                      $("."+type + "group").find('button:first').html('选择优惠券');
                }
   
    function select_coupon(o,obj) {
         
         
         var type = $(obj).closest('.content').data('name')=='reccouponid'?'rec':'sub';
         $("."+type + "group").find('button:first').html( "赠送优惠券: [" + o.id + "]" + o.couponname );
         
    }
{/if}
	
    </script>